from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response


class PageNum(PageNumberPagination):

    # page_query_param = 'pa'
    page_size_query_param = 'pagesize'
    # page_size =  2
    max_page_size = 10

    def get_paginated_response(self, data):
        return Response({
            "lists": data,
            "page": self.page.number,
            "pages": self.page.paginator.num_pages,
            'pagesize': self.page.paginator.per_page,
            "counts": self.page.paginator.count,

        })